The present embodiments relate to a method for coding a data stream a corresponding coding device and a transmitting apparatus, and a method and an apparatus for transmitting a data stream.
It is known practice from the prior art to compress a data stream in a lossless manner using entropy coding. In this case, relatively short codes are assigned to symbols in the data stream that occur relatively often, with the result that the total length of the coded data stream is reduced. The corresponding symbols are assigned to codes based on a code table that allocates the corresponding codes to the symbols. Since the frequency of symbols in different sections of a data stream may be different, possibly different code tables may be used for different sections or blocks of the data stream. Since the code tables are to be transmitted to the corresponding decoder in order to decode the data stream, the number of the tables may be suitably restricted.
The document by Farshid Golchin et al: “Minimum-entropy clustering and its application to lossless image coding,” PROC. OF INT. CONF. ON IMAGE PROCESSING, vol. 2, Oct. 26, 1997, pages 262-265, discloses entropy coding in which the blocks to be coded are iteratively assigned to clusters. The allocation to the clusters is carried out such that the entropy of the respective cluster is as small as possible. The blocks belonging to the respective cluster are entropy-coded based on the probability distribution of the symbols in the respective cluster.